#include "events_base.hpp"
#include "xthread_pool.hpp"

#include <iostream>

#include <mysql/mysql.h>
#include <glog/logging.h>

#include <signal.h>
MYSQL mysql;
MYSQL_RES* res;
MYSQL_ROW row;
unsigned int num_fileds;
using namespace std;
void setLog()
{
    FLAGS_v = 2;
    FLAGS_logtostderr = false;
    FLAGS_log_dir = "/home/chen/cpp/cpp2/test9/log";
    FLAGS_max_log_size = 100;
}
int main(int argc,char **argv)
{
    FLAGS_alsologtostderr = 1;
    if(signal(SIGPIPE, SIG_IGN) == SIG_ERR)
		return 1;
    FLAGS_logtostderr = 1;
	google::InitGoogleLogging(argv[0]);
    setLog();

    events_base *base = new events_base();
    auto thread_pool = xthread_pool::getInstance();
    thread_pool->init_thread(5);
    base->event_init();
    base->event_run();



}